package zjc.数组;


import java.util.Random;

public class 随机排顺序 {
    public static void main(String[] args) {
        //案例随机给五个人排序
        Random sj=new Random();
        String[] names =new String[]{"蔡胜超","徐佳明","陈斌","周俊","胡景伟"};
        String name;
        int n;
        for(int i=0;i<names.length;i++){
            n= sj.nextInt(5);
            name = names[i];
            names[i]=names[n];
            names[n]=name;
        }
        for (int i = 0; i < names.length; i++) {
            System.out.println(names[i]+"妈的排第"+(i+1)+"个去");
        }
    }
}
